//
//  FilterButton.m
//  MyProject
//
//  Created by 石小强 on 2018/5/3.
//  Copyright © 2018年 yanjiaming. All rights reserved.
//

#import "FilterButton.h"

@implementation FilterButton

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:13];
        self.layer.cornerRadius = 13.5;
        self.layer.masksToBounds = YES;
        self.backgroundColor = UIColorFromRGB(0xE2F2F4);
//        self.titleLabel.textColor = UIColorFromRGB(0x43C4D1);
        [self setTitleColor:UIColorFromRGB(0x43C4D1) forState:UIControlStateNormal];
        [self setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
    }
    return self;
}

- (void)setSelected:(BOOL)selected {
    [super setSelected:selected];
    
    if (selected) {
        self.backgroundColor = UIColorFromRGB(0x43C4D1);
//        self.titleLabel.textColor = [UIColor whiteColor];
    } else {
        self.backgroundColor = UIColorFromRGB(0xE2F2F4);
//        self.titleLabel.textColor = UIColorFromRGB(0x43C4D1);
    }
}

@end
